#ifndef PLANE_H_
#define PLANE_H_

#include "Object.h"

class Plane :
	public Object
{
public:
	Plane(Vec3 p = Vec3(0, -5, 0), Vec3 d = Vec3(0.0f, 1.0f ,-0.0f))
		: _point(p), _normal(d)
	{}
	virtual ~Plane(void);

	Vec3 _point;
	Vec3 _normal;

	float Intersect(const Ray & ray)
	{
		return  (_point * _normal - ray._origin * _normal) / (_normal * ray._direction);
	}

	virtual IntersectionInfo GetIntersectionInfo(const Vec3 & point)
	{
		return IntersectionInfo(_normal, &_material);
	}
};

#endif
